<html>
<#setting datetime_format="yyyy-MM-dd HH:mm:ss"/>

<title>电柜心跳数据</title>

<body>

<#assign tempDate=0/>

<#assign tempBgcolor="#ffffff"/>

<h3>电柜心跳数据-列表：${cabinetId}</h3>

<table border="1px solid #8968CD" style="border-collapse: collapse;">
    <tr bgcolor="#a9a9a9">
        <th style="padding: 10px">序号</th>
        <th style="padding: 10px" colspan=${maxLastNum}>电池信息</th>

        <th style="padding: 10px">状态</th>
        <th style="padding: 10px">时间</th>
        <th style="padding: 10px">时间差</th>
    </tr>

    <#list outList as outBean>
        <tr>
            <td style="padding: 10px">${(outBean?counter)+((curPage-1)*pageSize)}</td>

                <#list outBean.heartList as heartBean>

                    <#if (heartBean.battery == "0000000000000000")
                    ||(heartBean.battery == "0102030405060708")
                    ||(heartBean.battery == "FFFFFFFFFFFFFFFF")
                    >
                        <#assign bgBatColor = "white"  />
                    <#else>
                        <#assign bgBatColor = "#32cd32"  />
                    </#if>

                <td style="padding: 10px" bgcolor=${bgBatColor}>
                    仓门：${heartBean.door}<br>
                    ${heartBean.battery}
                </td>
                </#list>


        <#assign diffBatNum = outBean.thisBatNum - outBean.lastBatNum  />

        <#if (diffBatNum > 0) >
            <#assign diffBatNumColor = "green"  />
            <#assign diffBatNumShow =diffBatNum/>
        <#elseif (diffBatNum < 0) >
            <#assign diffBatNumColor = "red"  />
            <#assign diffBatNumShow =diffBatNum/>
        <#else>
            <#assign diffBatNumColor = "white"  />
            <#assign diffBatNumShow = ""/>
        </#if>

            <td style="padding: 10px" bgcolor=${diffBatNumColor}>
                ${diffBatNumShow}
            </td>

            <td style="padding: 10px">
                ${(outBean.time*1000)?number_to_datetime!}
            </td>

             <#if (outBean.lastTime == 0) >
                 <#assign diffTime = 0 />
             <#else>
                 <#assign diffTime = outBean.time - outBean.lastTime  />
             </#if>
            <td style="padding: 10px">${diffTime}</td>
        </tr>
    </#list>

</table>

</body>
</html>


